﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Lincolnwood.Foundation.SermonLibrary" namespace="Lincolnwood.Foundation.SermonLibrary" default-lazy="false">
  <class name="Sermon" table="Sermon">
    <id name="Id" access="field.camelcase-underscore">
      <generator class="guid"/>
    </id>
    <property name="Title" not-null="true"/>
    <property name="Description"/>
    <component name="Speaker"  class="Speaker">
      <property name="FirstName" column="SpeakerFirstName" not-null="true"/>
      <property name="LastName" column="SpeakerLastName" not-null="true"/>
      <property name="Title" column="SpeakerTitle"/>
    </component>
    <property name="RecordedAtLocation" not-null="true"/>
    <property name="RecordedDate" not-null="true"/>
    <property name="IsPublished"/>
    <component name="Media" class="MediaLink">
      <property name="MediaUri" not-null="true"/>
      <property name="MediaType" not-null="true"/>
    </component>
    <set name="ScriptureReferences" access="field.camelcase-underscore" cascade="all">
      <key column="SermonId" foreign-key="fk_ScriptureReferences_Sermon"/>
      <composite-element class="ScriptureReference">
        <property name="BookNumber" access="field.camelcase-underscore" not-null="true"/>
        <property name="BookName" access="field.camelcase-underscore" not-null="true"/>
        <property name="BookShortName" access="field.camelcase-underscore" not-null="true"/>
        <property name="Chapter" access="field.camelcase-underscore"/>
        <property name="VerseBegin" access="field.camelcase-underscore"/>
        <property name="VerseEnd" access="field.camelcase-underscore"/>
      </composite-element>
    </set>
    <many-to-one name="Series" class="SermonSeries" column="SermonSeriesId" />
    <property name="CreatedOn" not-null="true"/>
    <property name="CreatedBy"/>
    <property name="ModifiedOn"/>
    <property name="ModifiedBy"/>
  </class>
</hibernate-mapping>
